﻿using AntDesign.ProLayout;
using Microsoft.AspNetCore.Components;

namespace oms.Shared.Layouts
{
    public partial class BasicLayout : LayoutComponentBase, IDisposable
    {
        private MenuDataItem[]? _menuData;

        [Inject] private ReuseTabsService? TabService { get; set; }

        protected override Task OnInitializedAsync()
        {
            _menuData =
            [
                new MenuDataItem
                {
                    Path = "/",
                    Name = "welcome",
                    Key = "welcome",
                    Icon = "smile",
                },
                new MenuDataItem
                {
                    Path = "/Test",
                    Name = "test",
                    Key = "test",
                    Icon = "Home"
                }
            ];
            return Task.CompletedTask;
        }

        void Reload()
        {
            TabService?.ReloadPage();
        }

        public void Dispose()
        {
        }
    }
}